package com.group.mall.service.Impl;

import com.group.mall.domain.POJO.Comments;
import com.group.mall.domain.POJO.Goods;
import com.group.mall.domain.VO.GoodsImageAndNameVO;
import com.group.mall.mapper.CommentsMapper;
import com.group.mall.service.CommentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentsServiceImpl implements CommentsService {

    @Autowired
    private CommentsMapper commentsMapper;
    /**
     * 根据Id获取历史评价
     * @param
     * @return
     */
    public List<Comments> getComments() {
        List<Comments> commentsList = commentsMapper.getComments();
        return commentsList;
    }

    @Override
    public String getUserName(Long id) {
        String userName = commentsMapper.getUserName(id);
        return userName;
    }

    @Override
    public String getImage(Long goodsId) {
        String image = commentsMapper.getImage(goodsId);
        return image;
    }

    @Override
        public List<GoodsImageAndNameVO> getGoodsImageAndName(Long goodsId)
    {
        List<GoodsImageAndNameVO> goodsImageAndNameVOList = commentsMapper.getGoodsImageAndName(goodsId);
        return goodsImageAndNameVOList;
    };

    @Override
    public List<Comments> getCommentList(Integer goodsId) {
        return commentsMapper.getCommentList(goodsId);
    }

    @Override
    public List<Comments> getCommentLimitList(Integer goodsId) {
        return commentsMapper.getCommentLimitList(goodsId);
    }
}
